#include "frame_animate_config.h"

USING_NS_CC;
using std::map;
using std::pair;
using std::make_pair;

CharacterActionAnimate *CharacterActionAnimate::_instance = nullptr;

CharacterActionAnimate* CharacterActionAnimate::getInstance()
{
	if ( _instance == nullptr )
		_instance = new CharacterActionAnimate();
	return _instance;
}

CharacterActionAnimate::CharacterActionAnimate()
    :_actionAnimateMap()
{
    _actionAnimateMap.insert(make_pair(ActionType::WAIT, FrameAnimateInfo(30, 6, 0.4f)));
    _actionAnimateMap.insert(make_pair(ActionType::MOVE, FrameAnimateInfo(40, 8, 0.125f)));
}

const FrameAnimateInfo& CharacterActionAnimate::getAnimateInfo(ActionType action)
{
	return _actionAnimateMap[action];
}